﻿namespace CSharpPro._1030;

public class Student
{
    private int _id;
    private string _name;
    private string _sex;
    private int _age;

// 公共属性（提供外部访问和修改的接口）
    public int Id
    {
        get { return _id; }    // 获取私有字段的值
        set { _id = value; }   // 设置私有字段的值
    }

    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    public string Sex
    {
        get { return _sex; }
        set { _sex = value; }
    }

    public int Age
    {
        get { return _age; }
        set { _age = value; }
    }
}